public class Work81602 {
    public static void main(String[] args) {
        int num=10000;
        for(num=10000; num<99999; num++){
            int num1=num%10*10000 +num/10%10*1000 +num/100%10*100 +num/1000%10*10 +num/10000%10;
            if(num*4==num1)
                System.out.println(num);
        }
        }
    }
